﻿<link href="/Content/css/styles.css" rel="stylesheet">
<div class="content div-block">
    <h5>Lượt click</h5>
    <h3 style="color: red;" id="h3-click">@ViewData["click"]</h3>
</div>
<div class="content div-block">
    <h5>Order thành công</h5>
    <h3 style="color: red;" id="h3-order">@ViewData["order"]</h3>
</div>
<div class="content div-block">
    <h5>Tổng số tiền</h5>
    <h3 style="color: red;" id="h3-money">@ViewData["totalmoney"]đ</h3>
</div>
<div class="content div-block">
    <h5>Số tiền thu được</h5>
    <h3 style="color: red;" id="h3-moneyget">@(float.Parse(ViewData["totalmoney"].ToString())*5/100)đ</h3>
</div>
<div class="div-chart table-user-statistic">
    <h4 style="text-align: center">Top Website Quảng cáo</h4>
    <table class="table table-hover sort table-bordered">
        <thead>
            <tr>
                <th>Website
                </th>
                <th>Click
                </th>
                <th>Order Done
                </th>
                <th>Total Money
                </th>
            </tr>
        </thead>
        <tbody id="tbody-domain">
        </tbody>
    </table>
</div>
<div style="clear:both"></div>
<script>
    $.post('@Url.Action("GetRefStatistic", "Home")', { time: 'all' }, function (data) {
        $('#tbody-domain').html('');
        var tHtml = '';
        var dHtml = '';
        for (var i = 0; i < data.domains.length; i++) {
            dHtml += '<tr>'
                    + '<td>' + data.domains[i].domain + '</td>'
                    + '<td>' + data.domains[i].click + '</td>'
                    + '<td>' + data.domains[i].order + '</td>'
                    + '<td>' + data.domains[i].money + '</td>'
                    + '</tr>'
        }
        $('#tbody-domain').html(dHtml);
    });
</script>
